package com.xtt.dynamic.datasource.service.impl;


import com.xtt.dynamic.datasource.annotation.WR;
import com.xtt.dynamic.datasource.entity.Friend;
import com.xtt.dynamic.datasource.entity.Operation;
import com.xtt.dynamic.datasource.mapper.FriendMapper;
import com.xtt.dynamic.datasource.service.FriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FriendServiceImpl implements FriendService {
    @Autowired
    private FriendMapper friendMapper;

    @Override
    @WR(Operation.READ)
    public List<Friend> list() {
        return friendMapper.list();
    }

    @Override
    @WR(Operation.Write)
    public void save(Friend friend) {
        friendMapper.save(friend);
    }
}
